using Core;
using UnityEngine;

namespace g_gongjianta
{
    public class Dungeon : Unit, IAwake<int>
    {
        public TblDungeon.Conf Conf { get; private set; }

        public DungeonMainComponent Main { get; private set; }

        public void Awake(int id)
        {
            Awake();

            Conf = G.Table.GetSO<TblDungeon>().Find(id);
            Debug.Assert(Conf != null);

#if UNITY_EDITOR
            gameObject.name = $"Dungeon_{id}_{InstanceId}";
#endif

            Main = Add<DungeonMainComponent>();
        }

        public override void Dispose()
        {
            if (IsDisposed) return;

            base.Dispose();
        }
    }
}